package com.jhgsys.internal.sypq.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wuwenze.poi.annotation.Excel;
import com.wuwenze.poi.annotation.ExcelField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Date;

@Data
@Excel("项目信息")
public class SypqProjectExcelDto implements Serializable {

    /**
     * 项目编码,编码规则：PJ+年+月+四位序列号
     */
    @TableId(value = "project_code", type = IdType.ASSIGN_UUID)
    @Size(max = 32, message = "{noMoreThan}")
    @ExcelField(value = "项目编码", width = 120)
    private String projectCode;

    // @ExcelField(value = "状态", writeConverterExp = "0=正常,1=暂停")
    /**
     * 项目名称
     */
    @TableField("project_name")
    @NotBlank(message = "{required}")
    @Size(max = 90, message = "{noMoreThan}")
    @ExcelField(value = "项目名称", width = 300)
    private String projectName;

    /**
     * 客户编码
     */
    @TableField("cust_code")
    @NotBlank(message = "{required}")
    @Size(max = 32, message = "{noMoreThan}")
    @ExcelField(value = "客户编码", width = 120)
    private String custCode;

    @ExcelField(value = "客户名称", width = 200)
    @Schema(description = "客户名称")
    private String custName;


    @ExcelField(value = "联系人", width = 80)
    @Schema(description = "联系人")
    private String contact;

    @ExcelField(value = "联系方式", width = 100)
    @Schema(description = "联系方式")
    private String telephone;

    @ExcelField(value = "项目经理", width = 500)
    @Schema(description = "项目经理")
    private String managers;

    @ExcelField(value = "审批人", width = 100)
    @Schema(description = "审批人")
    private String auditor;

    @ExcelField(value = "项目状态", width = 80)
    @Schema(description = "项目状态")
    private String statusName;

    @ExcelField(value = "审批状态", width = 80)
    @Schema(description = "审批状态")
    private String approveStatusName;

    @Schema(description = "审批意见")
    private String remark;

    /**
     * 试验要求
     */
    @TableField("test_demand")
    @Size(max = 4000, message = "{noMoreThan}")
    @ExcelField(value = "试验要求", width = 400)
    private String testDemand;


    /**
     * 项目状态,数据字典PROJECT_STATUS,4:待排期,5:已排期,6:试验中,7:已完成,8:已终止
     */
    @TableField("status")
    @NotNull(message = "{required}")
    private Integer status;

    /**
     * 期望开始时间
     */
    @TableField("expect_startdate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ExcelField(value = "期望开始时间", width = 150, dateFormat = "yyyy-MM-dd HH:mm")
    private Date expectStartdate;

    /**
     * 期望结束时间
     */
    @TableField("expect_enddate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ExcelField(value = "期望结束时间", width = 150, dateFormat = "yyyy-MM-dd HH:mm")
    private Date expectEnddate;

    /**
     * 计划开始时间
     */
    @TableField("plan_startdate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ExcelField(value = "计划开始时间", width = 150, dateFormat = "yyyy-MM-dd HH:mm")
    private Date planStartdate;

    /**
     * 计划结束时间
     */
    @TableField("plan_enddate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ExcelField(value = "计划结束时间", width = 150, dateFormat = "yyyy-MM-dd HH:mm")
    private Date planEnddate;

    /**
     * 实际开始时间
     */
    @TableField("actual_startdate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ExcelField(value = "实际开始时间", width = 150, dateFormat = "yyyy-MM-dd HH:mm")
    private Date actualStartdate;

    /**
     * 实际结束时间
     */
    @TableField("actual_enddate")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ExcelField(value = "实际结束时间", width = 150, dateFormat = "yyyy-MM-dd HH:mm")
    private Date actualEnddate;

    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ExcelField(value = "创建时间", width = 150, dateFormat = "yyyy-MM-dd HH:mm")
    private Date createdTime;

    /**
     * 审批状态,数据字典APPROVE_STATUS,1:草稿,2:待审核,3:已驳回,4:已通过
     */
    @TableField("approve_status")
    private Integer approveStatus;

    @TableField("managerids")
    @NotBlank(message = "{required}")
    @Size(max = 350, message = "{noMoreThan}")
    private String managerids;

    /**
     * 项目审批人,userid
     */
    @TableField("auditorid")
    @NotBlank(message = "{required}")
    @Size(max = 32, message = "{noMoreThan}")
    private String auditorid;
}
